package com.example.springboot.bean;

import javax.persistence.*;
import java.sql.Date;


/**
 * Created by tang on 2018/3/8.
 */
@Entity
@Table(name = "book_shopping_records")
public class ShoppingRecord {
    private int id;
    private String bookName;
    private String customerName;
    private Date date;

    public ShoppingRecord() {
    }

    public ShoppingRecord(String bookName, String customerName, Date date) {
        this.bookName = bookName;
        this.customerName = customerName;
        this.date = date;
    }

    @Id
    @GeneratedValue(strategy = GenerationType.AUTO)
    @Column(name = "id")
    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    @Column(name = "bookName")
    public String getBookName() {
        return bookName;
    }

    public void setBookName(String bookName) {
        this.bookName = bookName;
    }

    @Column(name = "customerName")
    public String getCustomerName() {
        return customerName;
    }

    public void setCustomerName(String customerName) {
        this.customerName = customerName;
    }

    @Column(name = "date")
    public Date getDate() {
        return date;
    }

    public void setDate(Date date) {
        this.date = date;
    }

    @Override
    public String toString() {
        return "ShoppingRecord{" +
                "id=" + id +
                ", bookName='" + bookName + '\'' +
                ", customerName='" + customerName + '\'' +
                ", date=" + date +
                '}';
    }
}
